package com.qf.controller;
import com.qf.bean.Major;
import com.qf.service.MajorService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class MajorController {
    @Resource
    private MajorService majorService;
@RequestMapping("/getmajor")
@ResponseBody
    public List<Major> list(int did, ModelMap modelMap) {
    System.out.println(did);
    List<Major> list = majorService.find(did);
    modelMap.addAttribute("major", list);
    return list;
}

}



